An Optimal Algorithm for Finding the Longest Increasing Subsequence of Every Substring
نویسندگان
چکیده
Given a string S = {a1, a2, a3, · · · , an}, the longest increasing subsequence (LIS) problem is to find a subsequence of the given string such that the subsequence is increasing and its length is maximal. In a previous result, to find the longest increasing subsequences of each sliding windows with a fixed size w of a given string can be solved in O(w log log n + OUTPUT ) time, where O(w log log n) is taken for preprocessing. In this paper, we solve the problem for finding the longest increasing subsequence of every substring of S. With the straightforward implementation of the previous result, the time required for the preprocessing would be O(n log log n). With the modification of the data structure used in the algorithm, our algorithm needs only O(n) preprocessing time. Since there are O(n) substrings totally in a given string with length n, our algorithm is optimal. The time required for the reporting stage is linear to the size of the output. In other words, our algorithm can find the LIS of every substring in O(n+OUTPUT ) time, where OUTPUT is the sum of the lengths of the outputs.
منابع مشابه
Parallel algorithms for the longest common subsequence problem
The longest common subsequence problem is to nd a substring that is common to two given strings and is atleast as long as any other such string. If m and n are the lengths of the two strings (m n), we obtain O(log m) time parallel algorithm with mn processors and an O(log 2 n) time optimal parallel algorithm. Serial complexity on decision tree model is (mn).
متن کاملFinding a Longest Increasing Subsequence from the Paths in a Complete Bipartite Graph∗
Let S = s1, s2, . . . , sn be an integer sequence. The longest increasing subsequence problem is to find an increasing subsequence of S with the longest length. By regarding S as a weight sequence of the vertices in a path, we can redefine the longest increasing subsequence problem on graphs as follows. Let G = (V,E) be a graph in which every vertex v ∈ V has a weight w(v). A longest increasing...
متن کاملQuadratic-time Algorithm for the String Constrained LCS Problem
The problem of finding a longest common subsequence of two main sequences with some constraint that must be a substring of the result (STR-IC-LCS) was formulated recently. It is a variant of the constrained longest common subsequence problem. As the known algorithms for the STR-IC-LCS problem are cubic-time, the presented quadratic-time algorithm is significantly faster.
متن کاملEfficient Representation and Parallel Computation of String-Substring Longest Common Subsequences
Given two strings a, b of length m, n respectively, the string-substring longest common subsequence (SS-LCS) problem consists in computing the length of the longest common subsequence of a and every substring of b. An explicit representation of the output lengths is of size Θ(n). We show that the output can be represented implicitly by a set of n two-dimensional integer points, where individual...
متن کاملPath algebra algorithm for finding longest increasing subsequence
New algorithm for finding longest increasing subsequence is discussed. This algorithm is based on the ideas of idempotent mathematic and uses Max-Plus idempotent semiring. Problem of finding longest increasing subsequence is reformulated in a matrix form and solved with linear algebra.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2006